home *** CD-ROM | disk | FTP | other *** search
/ QuickTime for the Web (2nd Edition) / QuickTime for the Web (2nd Edition).iso / pc / AppleScript / QUICKTIME 5.0.2 SCRIPTS / Example Files / Automation Example / Hotpick Builder.txt next >
Encoding:
Text File  |  2001-06-05  |  3.5 KB  |  111 lines

  1. property movie_width : 208
  2. property movie_height : 302
  3.  
  4. property QTlogo_filename : "qlogo.jpg"
  5. property QT_HREF : "http://www.apple.com/quicktime/"
  6. property QTlogo_offset : {0, 0}
  7.  
  8. property HPlogo_filename : "hotpickslogo.jpg"
  9. property Hotpicks_HREF : "http://www.apple.com/quicktime/hotpicks/"
  10. property HPlogo_offset : {0, 160}
  11.  
  12. property hotpick1_filename : "hotpick1.jpg"
  13. property hotpick1_offset : {19, 205}
  14.  
  15. property HP1text_filename : "hotpick1_text.txt"
  16. property HP1text_width : 170
  17. property HP1text_height : 43
  18. property HP1text_position : {19, 259}
  19. property HP1HREF_filename : "hotpick1_href.txt"
  20.  
  21. try
  22.     display dialog "Hotpick Builder" & return & return & ¬
  23.         "This script demonstrates how movies can be auto-generated by building a movie from elements located in the same folder as this script."
  24.     
  25.     set this_app to the path to me
  26.     set AppleScript's text item delimiters to ":"
  27.     set the source_folder to ((text items 1 thru -2 of (this_app as string)) as string) & ":"
  28.     set AppleScript's text item delimiters to ""
  29.     
  30.     try
  31.         set QTLogo to alias ((source_folder & QTlogo_filename) as string)
  32.         set HP_logo to alias ((source_folder & HPlogo_filename) as string)
  33.         set Hotpick1_image to alias ((source_folder & hotpick1_filename) as string)
  34.         set Hotpick1_textfile to alias ((source_folder & HP1text_filename) as string)
  35.         set Hotpick1_hreffile to alias ((source_folder & HP1HREF_filename) as string)
  36.     on error
  37.         error "The required images must be in the same folder as this script."
  38.     end try
  39.     
  40.     set hotpick1_text to read Hotpick1_textfile
  41.     set hotpick1_HREF to read Hotpick1_hreffile
  42.     
  43.     tell application "QuickTime Player"
  44.         launch -- bypass promo movie
  45.         activate
  46.         
  47.         stop every movie
  48.         
  49.         make new movie
  50.         
  51.         set the full text of annotation "Full Name" of movie 1 to "Hotpicks Movie"
  52.         
  53.         -- CREATE THE BACKGROUND TRACK
  54.         set this_track to make new track at movie 1 with data " "
  55.         tell this_track
  56.             set dimensions to {movie_width, movie_height}
  57.             set the position to {0, 0}
  58.             tell frame 1
  59.                 set background color to {65535, 65535, 65535}
  60.             end tell
  61.             set the name to "Background"
  62.         end tell
  63.         
  64.         -- CREATE THE QT LOGO TRACK
  65.         set this_track to make new track at movie 1 with data QTLogo
  66.         tell this_track
  67.             set the position to QTlogo_offset
  68.             set href to QT_HREF
  69.             set the name to "QT logo"
  70.         end tell
  71.         
  72.         -- CREATE THE HOTPICKS LOGO TRACK
  73.         set this_track to make new track at movie 1 with data HP_logo
  74.         tell this_track
  75.             set the position to HPlogo_offset
  76.             set href to Hotpicks_HREF
  77.             set the name to "Hotpicks logo"
  78.         end tell
  79.         
  80.         -- CREATE THE HOTPICKS IMAGE TRACK
  81.         set this_track to make new track at movie 1 with data Hotpick1_image
  82.         tell this_track
  83.             set the position to hotpick1_offset
  84.             set href to hotpick1_HREF
  85.             set the name to "Hotpick 1"
  86.         end tell
  87.         
  88.         -- CREATE THE HOTPICKS TEXT TRACK
  89.         set this_track to make new track at movie 1 with data hotpick1_text
  90.         tell this_track
  91.             set the dimensions to {HP1text_width, HP1text_height}
  92.             set position to HP1text_position
  93.             tell frame 1
  94.                 set the dimensions to {HP1text_width, HP1text_height}
  95.                 set the background color to {65535, 65535, 65535}
  96.                 set the foreground color to {0, 0, 0}
  97.                 set the default font to "Geneva"
  98.                 set the default font size to 9
  99.                 set the justification to center
  100.             end tell
  101.             set the name to "Hotpick 1 Description"
  102.         end tell
  103.     end tell
  104. on error error_message number error_number
  105.     if the error_number is not -128 then
  106.         activate
  107.         beep
  108.         display dialog error_message buttons {"Cancel"} default button 1
  109.     end if
  110. end try
  111.